home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / misc / o-z / x-windows / mesa-amiwin / include / gl / glx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-12  |  4.7 KB  |  218 lines

  1. /* glx.h */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25. $Id: glx.h,v 1.10 1995/10/12 16:58:37 brianp Exp $
  26.  
  27. $Log: glx.h,v $
  28.  * Revision 1.10  1995/10/12  16:58:37  brianp
  29.  * updated notes to reflect latest code changes
  30.  *
  31.  * Revision 1.9  1995/08/03  19:34:37  brianp
  32.  * explictly assigned values to GLX_ symbols to match OpenGL
  33.  *
  34.  * Revision 1.8  1995/07/28  15:01:05  brianp
  35.  * added a few notes on using GLX
  36.  *
  37.  * Revision 1.7  1995/05/22  17:03:21  brianp
  38.  * Release 1.2
  39.  *
  40.  * Revision 1.6  1995/04/28  20:04:36  brianp
  41.  * rename GLX_BAD_ATTRIB to GLX_BAD_ATTRIBUTE
  42.  *
  43.  * Revision 1.5  1995/04/17  14:42:00  brianp
  44.  * added GLX version 1.1 functions and symbols
  45.  *
  46.  * Revision 1.4  1995/04/05  18:29:41  brianp
  47.  * added GLX error constants
  48.  *
  49.  * Revision 1.3  1995/03/04  19:45:47  brianp
  50.  * 1.1 beta revision
  51.  *
  52.  * Revision 1.2  1995/02/28  21:22:39  brianp
  53.  * fixed a typo
  54.  *
  55.  * Revision 1.1  1995/02/28  21:21:03  brianp
  56.  * Initial revision
  57.  *
  58.  */
  59.  
  60.  
  61. #ifndef GLX_H
  62. #define GLX_H
  63.  
  64.  
  65. /*
  66.  * A pseudo-GLX implementation to allow GLX-based OpenGL programs to
  67.  * work with Mesa.
  68.  *
  69.  * Notes:
  70.  *   1. If the visual passed to glXGetConfig was not one returned by
  71.  *      glXChooseVisual then the GLX_RGBA and GLX_DOUBLEBUFFER queries
  72.  *      will always return True and the GLX_DEPTH_SIZE query will always
  73.  *      return non-zero.
  74.  *   2. The glXIsDirect() function always returns True.
  75.  */
  76.  
  77.  
  78.  
  79. #include <X11/Xlib.h>
  80. #include <X11/Xutil.h>
  81. #include "GL/xmesa.h"
  82.  
  83.  
  84. #ifdef __cplusplus
  85. extern "C" {
  86. #endif
  87.  
  88.  
  89. #define GLX_VERSION_1_1    1
  90.  
  91.  
  92. /*
  93.  * Tokens for glXChooseVisual and glXGetConfig:
  94.  */
  95. enum _GLX_CONFIGS {
  96.     GLX_USE_GL        = 1,
  97.     GLX_BUFFER_SIZE        = 2,
  98.     GLX_LEVEL        = 3,
  99.     GLX_RGBA        = 4,
  100.     GLX_DOUBLEBUFFER    = 5, 
  101.     GLX_STEREO        = 6,
  102.     GLX_AUX_BUFFERS        = 7,
  103.     GLX_RED_SIZE        = 8,
  104.     GLX_GREEN_SIZE        = 9,
  105.     GLX_BLUE_SIZE        = 10,
  106.     GLX_ALPHA_SIZE        = 11,
  107.     GLX_DEPTH_SIZE        = 12,
  108.     GLX_STENCIL_SIZE    = 13,
  109.     GLX_ACCUM_RED_SIZE    = 14,
  110.     GLX_ACCUM_GREEN_SIZE    = 15,
  111.     GLX_ACCUM_BLUE_SIZE    = 16,
  112.     GLX_ACCUM_ALPHA_SIZE    = 17,
  113.     GLX_SAMPLES_SGIS    = 100000,    /* SGI extension */
  114.     GLX_SAMPLE_BUFFER_SGIS    = 100001    /* SGI extension */
  115. };
  116.  
  117.  
  118. /*
  119.  * Error codes returned by glXGetConfig:
  120.  */
  121. #define GLX_BAD_SCREEN        1
  122. #define GLX_BAD_ATTRIBUTE    2
  123. #define GLX_NO_EXTENSION    3
  124. #define GLX_BAD_VISUAL        4
  125. #define GLX_BAD_CONTEXT        5
  126. #define GLX_BAD_VALUE           6
  127. #define GLX_BAD_ENUM        7
  128.  
  129.  
  130.  
  131. /*
  132.  * New in GLX 1.1:
  133.  */
  134. #define GLX_VENDOR    1
  135. #define GLX_VERSION    2
  136. #define GLX_EXTENSIONS     3
  137.  
  138.  
  139.  
  140. typedef XMesaContext GLXContext;
  141.  
  142. typedef Pixmap GLXPixmap;
  143.  
  144. typedef Drawable GLXDrawable;
  145.  
  146.  
  147.  
  148. extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
  149.                      int *attribList );
  150.  
  151. extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
  152.                     GLXContext shareList, Bool direct );
  153.  
  154.  
  155. extern void glXDestroyContext( Display *dpy, GLXContext ctx );
  156.  
  157.  
  158. extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
  159.                 GLXContext ctx);
  160.  
  161.  
  162. extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
  163.                 GLuint mask );
  164.  
  165.  
  166. extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
  167.  
  168.  
  169. extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
  170.                      Pixmap pixmap );
  171.  
  172.  
  173. extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
  174.  
  175.  
  176. extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
  177.  
  178.  
  179. extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
  180.  
  181.  
  182. extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
  183.  
  184.  
  185. extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
  186.              int attrib, int *value );
  187.  
  188.  
  189. extern GLXContext glXGetCurrentContext( void );
  190.  
  191.  
  192. extern GLXDrawable glXGetCurrentDrawable( void );
  193.  
  194.  
  195. extern void glXWaitGL( void );
  196.  
  197.  
  198. extern void glXWaitX( void );
  199.  
  200.  
  201. extern void glXUseXFont( Font font, int first, int count, int list );
  202.  
  203.  
  204. /* New in GLX version 1.1 */
  205. extern const char *glXQueryExtensionsString( Display *dpy, int screen );
  206.  
  207. extern const char *glXQueryServerString( Display *dpy, int screen, int name );
  208.  
  209. extern const char *glXGetClientString( Display *dpy, int name );
  210.  
  211.  
  212.  
  213. #ifdef __cplusplus
  214. }
  215. #endif
  216.  
  217. #endif
  218.